<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Cache-Control" content="no-cache"/>
	<meta http-equiv="Pragma" content="no-cache"/>
	<meta http-equiv="Expires" content="0"/>

	<title>#{msgs.page_layout_title}</title>
	<h:outputStylesheet library="css" name="app.css"/>
	<h:outputScript library="js" name="md5.js" target="head"/>

	<script type="text/javascript">
        function md5password() {
            var password = document.getElementById("loginform:password");
        	password.value = hex_md5(password.value);
        }
    </script>
    <style type="text/css">
	 .ui-panel-title {
	        color: red;
	        font-size: 16px;
	    } 
	 .ui-panel-footer {
	        color: red;
	        font-size: 16px;
	    }    
	</style>
		
</h:head>
<h:body style="background:url('#{request.contextPath}/resources/images/bg_1.jpg')">

<div class="login_main">
	<h:form id="loginform">		
	<p:focus/>
	<p:growl id="messages" showDetail="true" />
	<p:spacer height="100"></p:spacer>
	<p:panel header="工程项目管理平台" footer="请输入正确的账号、密码进行登录。"  style="width:480px;text-align:center;">
		<f:facet name="footer" >
			<!-- <img src="#{request.contextPath}/resources/images/logo_foot.jpg" />  -->
			<h:outputText value="佛山益丰合泰建材有限公司" style="align:center;font-size:16px;color:blue;"/>
		</f:facet>
		<div class="login_txt fon">			
		<h:panelGrid columns="3" cellspacing="10" style="font-size:18px;">
			<p:outputLabel value="账&#160;&#160;&#160;&#160;号："></p:outputLabel>
			<p:inputText value="#{appShiroValidate.userno}" placeholder="输入登录帐号"
				onfocus="this.select();" style="width:160px;"
				required="true" requiredMessage="账号必须输入" 
				validator="#{appShiroValidate.validateUserno}" validatorMessage="账号验证不过" >						
			</p:inputText>
			<h:outputText value="&#160;&#160;&#160;" style="font-size:14px;color:blue;"/>
			<p:outputLabel value="密&#160;&#160;&#160;&#160;码："></p:outputLabel>
			<p:password value="#{appShiroValidate.password}" id="password"  
				placeholder="输入登录密码"
				onblur="md5password();" onfocus="this.select();" style="width:160px;"
				required="true"  requiredMessage="密码必须输入"
				validator="#{appShiroValidate.validatePassword}" validatorMessage="密码验证不过" >
			</p:password>
			<h:outputText value="&#160;&#160;&#160;" style="font-size:14px;color:blue;"/>

			<p:commandButton value="登录" icon="ui-icon-check" 
				update=":loginform:messages" action="#{appShiroValidate.login}">
			</p:commandButton>
			<p:commandButton value="退出" icon="ui-icon-power"
				update=":loginform:messages" onclick="window.opener=null;window.open('','_self','');window.close();">
			</p:commandButton>
			
			<br/>													
		</h:panelGrid>				
		</div>
		</p:panel>
		
	</h:form>
</div>

</h:body>
</html>
